package com.aorise.mapper.migration;

import com.aorise.model.migration.*;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.dao.DataAccessException;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

/**
* @Author:cat
* @Description 迁建记录mybatis接口类
* @Date:Created in 2019-05-29
* @Modified By:
*/
@Mapper
@Component(value = "migrationMapper")
public interface MigrationMapper {
    /**
     * @Author:cat
     * @Description 根据设备ID查询迁建记录信息
     * @params: map 查询条件Map
     * @Date:2019-05-29
     * @Return: List<MigrationModel> 迁建记录集合
     * @Modified By:
     */
    List<MigrationModel> getMigrationBycameraId(Map<String, Object> map) throws DataAccessException;

    /**
     * @Author:cat
     * @Description 查询点位迁建信息总条数
     * @params: map 查询条件Map
     * @Date:2019-06-03
     * @Return: Long 数据总条数
     * @Modified By:
     */
    Long getAllMigrationListTotalByPage(Map<String, Object> map) throws DataAccessException;

    /**
     * @Author:cat
     * @Description 分页查询点位迁建信息
     * @params: map 查询条件Map
     * @Date:2019-06-03
     * @Return: List<MigrationModel> 点位迁建集合
     * @Modified By:
     */
    List<MigrationModel> getAllMigrationListByPage(Map<String, Object> map) throws DataAccessException;

    /**
     * @Author:cat
     * @Description 根据ID查询点位迁建详情
     * @params: map 查询条件Map
     * @Date:2019-06-03
     * @Return: MigrationModel 点位迁建信息
     * @Modified By:
     */
    MigrationModel getMigrationById(Map<String, Object> map) throws DataAccessException;

    /**
     * @Author:cat
     * @Description 新增迁建记录信息
     * @params: migrationAddVO 迁建记录信息
     * @Date:2019-06-01
     * @Return: Integer 影响行数
     * @Modified By:
     */
    Integer addMigration(MigrationAddVO migrationAddVO) throws DataAccessException;

    /**
     * @Author:cat
     * @Description 删除点位迁建信息
     * @params: map 查询条件Map
     * @Date:2019-06-03
     * @Return: Integer 影响行数
     * @Modified By:
     */
    Integer deleteMigration(Map<String, Object> map) throws DataAccessException;

    /**
     * @Author:cat
     * @Description 查询昨天完成的点位迁建信息
     * @params: map 查询条件Map
     * @Date:2019-06-12
     * @Return: List<MigrationModel> 点位迁建集合
     * @Modified By:
     */
    List<MigrationModel> getFinishMigration(Map<String, Object> map) throws DataAccessException;

    /**
     * @Author:cat
     * @Description 更新点位迁建审批信息
     * @params: map 查询条件Map
     * @Date:2019-06-18
     * @Return: Integer 影响行数
     * @Modified By:
     */
    Integer updateMigration(Map<String, Object> map) throws DataAccessException;

    /**
     * @Author:cat
     * @Description 查询点位迁建待审批总条数
     * @params: map 查询条件Map
     * @Date:2019-06-19
     * @Return: Long 数据总条数
     * @Modified By:
     */
    Long getMigrationSum(Map<String, Object> map) throws DataAccessException;
}